package raytracing

import (
	"math/rand"
)

func Random() float64 {
	return rand.Float64()
}

func RandomBetween(min float64, max float64) float64 {
	return min + (max-min)*Random()
}

func Clamp(t float64, min float64, max float64) float64 {
	if t < min {
		return min
	} else if t > max {
		return max
	}
	return t
}
